<!--<p>heroes works!</p>-->
<!--<div class="parent">-->
<!--  <div class="child1">hero</div>-->
<!--  <input type="button" value="submit" class="child2" />-->
<!--</div>-->
<!--<div>-->
<!--  <label>name:-->
<!--    <input [(ngModel)]="Hero.name" placeholder="name"/>-->
<!--  </label>-->
<!--</div>-->

<h2>My Heroes</h2>
<ul class="heroes">
<!--  [class.selected]="hero === selectedHero"-->
  <li *ngFor="let hero of heroes" class="{{hero === selectedHero ? 'selected' : ''}}" (click)="onSelect(hero)">
    <span class="badge">{{hero.id}}</span> {{hero.name}}
    <button class="delete" title="delete hero"
            (click)="delete(hero)">x</button>
  </li>

</ul>

<app-hero-search></app-hero-search>

<div>
  <label>Hero name:
    <input #heroName />
  </label>
  <!-- (click) passes input value to add() and then clears the input -->
  <button (click)="add(heroName.value); heroName.value=''">
    add
  </button>
</div>

<app-hero-detail [hero]="selectedHero"></app-hero-detail>
